package com.foosun.core.entity;


import com.foosun.core.base.BaseEntity;
import com.foosun.core.util.JDBCName;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: xi
 * Date: 14-1-2
 * Time: 上午11:17
 * To change this template use File | Settings | File Templates.
 */
@JDBCName("C_RESOURCE_GROUP")
public class ResourceGroup extends BaseEntity {

    private String name; //组名称
    private Boolean isMenu;//菜单项
    private Boolean enable;//禁用
    private String title;//提示语
    private String memo;//备注
    private Integer order;//序号
    private String icon;//图标
    private Integer type;

    @Override
    public Map<String, Object> getEntityMap() {
        Map<String, Object> map = super.getEntityMap();
        map.put("name", name);
        map.put("title", title);
        map.put("memo", memo);
        map.put("order", order);
        map.put("is_menu", isMenu);
        map.put("enable", enable);
        map.put("icon", icon);
        map.put("type", type);
        return map;
    }


    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public GroupEnumType getEnumType() {
        if (type != null) {
            GroupEnumType[] types = GroupEnumType.values();
            for (GroupEnumType t : types) {
                if (t.code == type) return t;
            }
        }
        return GroupEnumType.COMMON;
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getIsMenu() {
        return isMenu;
    }

    public void setIsMenu(Boolean isMenu) {
        this.isMenu = isMenu;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
}
